package com.mininglamp.service;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import com.github.miemiedev.mybatis.paginator.domain.PageBounds;
import com.github.miemiedev.mybatis.paginator.domain.PageList;
import com.mininglamp.mapper.ZllzMapper;
import com.mininglamp.model.Zllz;
import com.mininglamp.utils.Pager;

@Service
public class ZllzService {

	@Autowired
	private ZllzMapper zllzMapper;
	
	public Pager list(Pager pager){
		PageBounds pageBounds = new PageBounds(pager.getPageNum(),pager.getPageSize());
		PageList<Zllz> lists = zllzMapper.list(pageBounds);
		
		pager.setDatas(lists);
		pager.setTotalNum(lists.getPaginator().getTotalCount());
		return pager;
	}
}
